public class Test {
    //打印斐波那锲数
    public static int fib(int n){
        int f1 = 1;
        int f2 = 1;
        int f3= 1;
        for (int i = 3; i <=n ; i++) {
            f3 = f1+f2;
            f1 = f2;
            f2 = f3;

        }
        return f3;
    }

    public static void main(String[] args) {
        System.out.println(fib(1));
        System.out.println(fib(2));
        System.out.println(fib(3));
        System.out.println(fib(4));
        System.out.println(fib(5));
        System.out.println(fib(6));
        System.out.println(fib(40));


    }







}
